package com.cn.jx.manager.po;

import static com.jx.util.CodeUtil.getRandomId;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import com.cn.jx.common.entity.BaseEntity;
import com.jx.enumType.YesNoEnum;

/**
 * <p>Resource 数据资源POJO类 对应数据库表名 SYS_RESOURCE
 * <p>实现<{@link Serializable <tt>序列化接口</tt>}
 * <p>实现<{@link BaseEntity <tt>BaseEntity</tt>}
 *  
 * @author <h1>jiangxu2  2019年11月21日</h1>
 * @version v1.11.20.2019
 * @since 1.0
 * 
 */
@Entity
@Table(name="SYS_RESOURCE")
public class Resource extends BaseEntity {

	private static final long serialVersionUID = -3667500435347656551L;

	/** <p>资源名称<p>设置为{@link String String}类型*/
	@Column(name="text",length=64)
	private String text;
	
	/** <p>资源编码<p>设置为{@link String String}类型*/
	@Column(name="code",length=64,unique=true,nullable=false)
	private String code;
	
	/** <p>资源地址<p>设置为{@link String String}类型*/
	@Column(name="url",length=256)
	private String url;
	
	/** <p>资源图标<p>设置为{@link String String}类型*/
	@Column(name="iconCls",length=64)
	private String iconCls;
	
	/** <p>资源归属父资源<p>设置为{@link String String}类型*/
	@Column(name="parent_id",length=64)
	private String parentId;
	
	/** <p>资源类型  菜单，按钮，页面元素，文件<p>设置为{@link String String}类型*/
	@Column(name="r_type",length=10)
	private String type;
	
	/** <p>所属应用<p>设置为{@link String String}类型*/
	@Column(name="r_apply",length=10)
	private String apply;
	
	/** <p>排序 <p>设置为{@link Integer Integer}类型*/
	@Column(name="sort")
	private Integer sort;
	
	
	/** <p>初始化创建类 @return */
	public static Resource getInstance(String operUser){
		Date day=new Date();
		Resource m=new Resource();
		m.setId(getRandomId());
		m.setDelFlg(YesNoEnum.NO.getCode());
		m.setValidFlg(YesNoEnum.YES.getCode());
		m.setCreateTime(day);
		m.setOperatTime(day);
		m.setOperatUser(operUser);
		m.setCreateUser(operUser);
		return m;
	}
	
	/** <p>{@link String String}<p>getSort()*/
	public Integer getSort() {
		return sort;
	}
	/** <p>{@link String String}<p>getType()*/
	public String getType() {
		return type;
	}
	/** <p>{@link String String}<p>getApply()*/
	public String getApply() {
		return apply;
	}
	/** <p>{@link String String}<p>getText()*/
	public String getText() {
		return text;
	}
	/** <p>{@link String String}<p>getCode()*/
	public String getCode() {
		return code;
	}
	/** <p>{@link String String}<p>getUrl()*/
	public String getUrl() {
		return url;
	}
	/** <p>{@link String String}<p>getIconCls()*/
	public String getIconCls() {
		return iconCls;
	}
	/** <p>{@link String String}<p>getParentId()*/
	public String getParentId() {
		return parentId;
	}
	
	/** <p>setSort({@link Integer sort})*/
	public void setSort(Integer sort) {
		this.sort = sort;
	}
	/** <p>setType({@link String type})*/
	public void setType(String type) {
		this.type = type;
	}
	/** <p>setApply({@link String apply})*/
	public void setApply(String apply) {
		this.apply = apply;
	}
	/** <p>setText({@link String text})*/
	public void setText(String text) {
		this.text = text;
	}
	/** <p>setCode({@link String code})*/
	public void setCode(String code) {
		this.code = code;
	}
	/** <p>setUrl({@link String  url})*/
	public void setUrl(String url) {
		this.url = url;
	}
	/** <p>setIconCls({@link String  iconCls})*/
	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}
	/** <p>setParentId({@link String  parentId})*/
	public void setParentId(String parentId) {
		this.parentId = parentId;
	}
}
